<?php
namespace  app\apishop\validate;
use think\Validate;

class UserValidate extends Validate
{
    protected $rule = [
        'account' => 'require',
        'type' => 'require|in:1,2',

        'name' => 'require',
        'pwd' => 'require',
        'user_shop_class_id' => 'require',
        'yield' => 'require',
        'license' => 'require',
        'username' => 'require',
        'identity' => 'require',
        'mobile' => 'require',
        'merchant_address' => 'require',
        'city' => 'require',
        'licenseimage' => 'require',
        'identitybackimage' => 'require',
        'identityjustimage' => 'require',
        'coverimage' => 'require',
        'lnglat' => 'require',
        'licenceimage' => 'require',
        'use_mobile' => 'require',
        'address' => 'require',
        'istype' => 'require',
    ];

    protected $message = [
        'account.require' => '请输入账号',
        'type.require' => '登录失败请检查登录方式',
        'type.in' => '登录失败请检查登录方式',

        'name.require' => '商户名称不能为空',
        'pwd.require' => '密码不能为空',
        'user_shop_class_id.require' => '商户类型不能为空',
        'yield.require' => '产权单位不能为空',
        'license.require' => '商户营业执照编号不能为空',
        'username.require' => '运营人姓名不能为空',
        'identity.require' => '身份证号不能为空',
        'mobile.require' => '手机号不能为空',
        'merchant_address.require' => '商户详细地址不能为空',
        'city.require' => '省/市/区不能为空',
        'licenseimage.require' => '营业执照不能为空',
        'identitybackimage.require' => '身份证国徽面不能为空',
        'identityjustimage.require' => '身份证人像面不能为空',
        'coverimage.require' => '门店抬头不能为空',
        'lnglat.require' => '经纬度不能为空',
        'licenceimage.require' => '营运许可证不能为空',
        'use_mobile.require' => '常用手机号不能为空',
        'address.require' => '常用地址不能为空',
    ];

    protected $scene = [
        'login' => ['account','pwd'],

        'shop_register' => ['pwd','name','user_shop_class_id','yield','license'
            ,'username','identity','mobile','merchant_address','city','licenseimage'
            ,'identitybackimage','identitybackimage','identityjustimage','coverimage','lnglat'
            ,'licenceimage','use_mobile','address'
        ],
    ];
}